home *** CD-ROM | disk | FTP | other *** search
/ Dictionaries & Language / Dictionaries and Language (Chestnut CD-ROM) (1993).iso / russian / cyrilic2 / trr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-06-15  |  3.2 KB  |  99 lines

  1. #include <stdio.h>
  2. #include <io.h>
  3. #define STDIN 0
  4. #define STDOUT 1
  5.  
  6. #define BUFFERSIZE 10000
  7. #define CYR_A  (unsigned char)176 /*░*/
  8. #define CYR_ya (unsigned char)239 /*∩*/
  9.  
  10. unsigned char buffer[BUFFERSIZE];
  11. int i,nread;
  12.  
  13. static unsigned char *upper[65]={
  14. "{\\mcyr A}",                     /*░*/
  15. "{\\mcyr B}",                     /*▒*/
  16. "{\\mcyr V}",                     /*▓*/
  17. "{\\mcyr G}",                     /*│*/
  18. "{\\mcyr D}",                     /*┤*/
  19. "{\\mcyr E}",                     /*╡*/
  20. "{\\mcyr Zh}",                    /*╢*/
  21. "{\\mcyr Z}",                     /*╖*/
  22. "{\\mcyr I}",                     /*╕*/
  23. "{\\mcyr \\accent\"24I}",          /*╣*/
  24. "{\\mcyr K}",                     /*║*/
  25. "{\\mcyr L}",                     /*╗*/
  26. "{\\mcyr M}",                     /*╝*/
  27. "{\\mcyr N}",                     /*╜*/
  28. "{\\mcyr O}",                     /*╛*/
  29. "{\\mcyr P}",                     /*┐*/
  30. "{\\mcyr R}",                     /*└*/
  31. "{\\mcyr S}",                     /*┴*/
  32. "{\\mcyr T}",                     /*┬*/
  33. "{\\mcyr U}",                     /*├*/
  34. "{\\mcyr F}",                     /*─*/
  35. "{\\mcyr Kh}",                    /*┼*/
  36. "{\\mcyr Ts}",                    /*╞*/
  37. "{\\mcyr Ch}",                    /*╟*/
  38. "{\\mcyr Sh}",                    /*╚*/
  39. "{\\mcyr Shch}",                  /*╔*/
  40. "{\\mcyr P2}",                    /*╩*/
  41. "{\\mcyr Y}",                     /*╦*/
  42. "{\\mcyr P1}",                    /*╠*/
  43. "{\\mcyr E1}",                    /*═*/
  44. "{\\mcyr Yu}",                    /*╬*/
  45. "{\\mcyr Ya}",                    /*╧*/
  46. "{\\mcyr a}",                     /*╨*/
  47. "{\\mcyr b}",                     /*╤*/
  48. "{\\mcyr v}",                     /*╥*/
  49. "{\\mcyr g}",                     /*╙*/
  50. "{\\mcyr d}",                     /*╘*/
  51. "{\\mcyr e}",                     /*╒*/
  52. "{\\mcyr zh}",                    /*╓*/
  53. "{\\mcyr z}",                     /*╫*/
  54. "{\\mcyr i}",                     /*╪*/
  55. "{\\mcyr \\accent\"24i}",          /*┘*/
  56. "{\\mcyr k}",                     /*┌*/
  57. "{\\mcyr l}",                     /*█*/
  58. "{\\mcyr m}",                     /*▄*/
  59. "{\\mcyr n}",                     /*▌*/
  60. "{\\mcyr o}",                     /*▐*/
  61. "{\\mcyr p}",                     /*▀*/
  62. "{\\mcyr r}",                     /*α*/
  63. "{\\mcyr s}",                     /*ß*/
  64. "{\\mcyr t}",                     /*Γ*/
  65. "{\\mcyr u}",                     /*π*/
  66. "{\\mcyr f}",                     /*Σ*/
  67. "{\\mcyr kh}",                    /*σ*/
  68. "{\\mcyr ts}",                    /*µ*/
  69. "{\\mcyr ch}",                    /*τ*/
  70. "{\\mcyr sh}",                    /*Φ*/
  71. "{\\mcyr shch}",                  /*Θ*/
  72. "{\\mcyr p2}",                    /*Ω*/
  73. "{\\mcyr y}",                     /*δ*/
  74. "{\\mcyr p1}",                    /*∞*/
  75. "{\\mcyr e1}",                    /*φ*/
  76. "{\\mcyr yu}",                    /*ε*/
  77. "{\\mcyr ya}",                    /*∩*/
  78. "{\\mcyr N0}"                     /*≡*/
  79. };
  80.  
  81. unsigned char *c;
  82.  
  83. void main(void)
  84. {
  85. while (nread=read(STDIN,(void *)buffer,BUFFERSIZE))
  86.     {
  87.     for (i=0; i<nread; i++)
  88.     {
  89.     if ((buffer[i]>=CYR_A)&&(buffer[i]<=CYR_ya))
  90.         {
  91.         for (c=upper[buffer[i]-CYR_A]; *c; c++)
  92.             write(STDOUT,c,1);
  93.         }
  94.     else
  95.         write(STDOUT,&buffer[i],1);
  96.     }
  97.     }
  98. }
  99.